<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

// 密码加密
if(!function_exists('encrypt_password')){
    function encrypt_password($password){
        $salt = 'dsafgdfsfsd';
        return md5(md5(trim($password).$salt));
    
    }}
    if(!function_exists('get_tree_list')){
        function buildTree($data, $parentId = 0)
        {
            $tree = [];
            foreach ($data as $node) {
                if ($node['parent_id'] == $parentId) {
                    $children = $this->buildTree($data, $node['id']);
                    if ($children) {
                        $node['children'] = $children;
                    }
                    $tree[] = $node;
                }
            }
            return $tree;
        }
    }
  